package com.example.demo;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class Test02 {
    public static void main(String[] args) throws ClassCastException, ClassNotFoundException {
        Class aClass =Class.forName("com.ndky.User");
        Method[] declaredMethods = aClass.getDeclaredMethods();
        for(Method declaredMethod : declaredMethods){
            System.out.println(declaredMethod);
        }
        System.out.println("======================");
        Field[] declaredClasses = aClass.getDeclaredFields();
        for (Field declaredClass : declaredClasses){
            System.out.println(declaredClass);
        }
    }

}
